{% extends 'index/base.html' %}

{% block title %}
<title>卡密充值-有间工作室</title>
{% endblock title %}

{% block js %}
<link rel="stylesheet" type="text/css" href="/static/index/css/reset.css">
<link rel="stylesheet" type="text/css" href="/static/index/css/main.css">
<script type="text/javascript" src="/static/index/js/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="/static/index/js/detail.js"></script>
<!-- <script type="text/javascript" src="../../利用TinyPXEServer+GhostCastServer实现网络克隆 机房电脑批量安装Windows操作系统/"></script> -->
<style type="text/css" id="syntaxhighlighteranchor"></style>
{% endblock js %}


{% block nav_bar %}
{% endblock nav_bar %}


{% block content %}
<section id="main" class="col-md-8">
    <article>
        <div class="kratos-hentry kratos-post-inner clearfix">
            <header class="kratos-entry-header">
                <h1 class="kratos-entry-title text-center"></h1>
            </header>
            <div class="kratos-post-content">
                <p></p>

                <div class="uc-panel">
                    <!-- <div class="uc-jifen-chongzhi uc-tac uc-hide" style="display: block;">
                            <p style="font-size:25px;"><strong class="color-red">微信充值方式：</strong></p>
                            <p>充值<strong class="color-red">10元人民币</strong>可以获得<strong
                                    class="color-red">50</strong>个积分以及<strong class="color-red">1</strong>月VIP</p>
                            <p>扫一扫支付，您的用户ID:<strong class="color-red">{{ user.id+10000 }}</strong>，付款时备注:<strong
                                    class="color-red">id{{ user.id+10000 }}</strong></p>
                            <p>24小时内积分到账。如忘记备注ID号，请联系“有间工作室”管理员或客服。</p>
                            <p><strong class="color-red">注：</strong></p>
                            <p>请支付对应金额，备注正确的ID号，若因个人原因造成的损失，网站概不负责</p>
                            <p><img src="http://ptc817zex.bkt.clouddn.com/微信图片_20190624120314.png" layer-index="1"></p>
                        </div> -->


                    <div class="uc-jifen-chongzhi uc-tac uc-hide" style="display: block;">
                        <p style="font-size:25px;"><strong class="color-red">卡密充值方式：</strong></p>
                        <!-- <aside id="kratos_search-2" class="widget widget_kratos_search clearfix">
                            <form role="search" method="get">
                                <div class="form-group">
                                    <input type="text" name="text" id="s" placeholder="Search…" class="form-control"
                                        style="width:50%;">
                                </div>
                            </form>
                        </aside> -->

                        <aside id="kratos_search-2" class="widget widget_kratos_search clearfix"
                            style='margin-bottom:10px;margin-left: 200px;'>
                            <form role="search" method="get">
                                <div class="form-group">
                                    <input type="text" name="text" id="s" placeholder="请输入卡号..."
                                        class="form-control val1" style="width:50%;">
                                </div>
                                <div class="form-group">
                                    <input type="text" name="search" id="s" placeholder="请输入卡密..."
                                        class="form-control val2" style="width:50%;">
                                </div>
                            </form>
                        </aside>

                        <a href="#" class="uc-btn other_pay_judge" user_id="{{ user.id }}"
                            style="margin-bottom: 30px;color:black;background-color:#f7a280;">确认充值</a>

                    </div>



                </div>
                <!-- <p>提示：取消相应操作（顶、踩、收藏等）会扣除已获得的积分，如果您看到积分为0或者记录不见了，表示该操作被删除。如果文章被删除，顶、踩、收藏等不会扣除积分。</p><p></p> -->
            </div>
        </div>



    </article>
</section>
{% endblock content %}



{% block js_2 %}
<script type="text/javascript">
    // alert('进来了')
    $('.other_pay_judge').click(function () {
        // 请求`退出登录`
        // alert('点击了')
        // layer.msg('水电费第三方')
        var card_num = $('.val1').val()
        var card_pass = $('.val2').val()
        // alert(user_id)
        // alert(card_num)
        // alert(card_pass)
        $.ajax({
            url: '/user/other_pay_judge',
            type: 'post',
            data: {
               "card_num": card_num,
               "card_pass":  card_pass
            },
            success: function (resp) {
                if (resp.errno == 0) {
                    // 卡密通过判断
                    layer.msg(resp.errmsg);
                    setTimeout(function () {
                        window.location.reload()
                    }, 2000)

                } else if (resp.errno) {
                    // 卡密不通过判断
                    layer.msg(resp.errmsg);
                }
            }
        })
    })
</script>
{% endblock js_2 %}